package com.model;

import com.util.DateUtil;

import java.util.Date;

/**
 * Created by shugen on 2017/1/5.
 * websocket  传递信息
 */
public class Message {
    private String sessionId;    //信息发送者 id
    private String userName;     //信息发送者 用户名
    private String time;         //时间
    private String type;          //信息类型  1.系统信息   2.群发信息   3. 单发信息
    private String title;          // 标题
    private String context;         //正文
    private String resiverId;          //单发时   接收者  id

    public Message(String sessionId, String userName, String time, String type, String title, String context, String resiverId) {
        this.sessionId = sessionId;
        this.userName = userName;
        if(time==null) time= DateUtil.DateToFullString(new Date());
        this.time = time;
        this.type = type;
        this.title = title;
        this.context = context;
        this.resiverId = resiverId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public String getResiverId() {
        return resiverId;
    }

    public void setResiverId(String resiverId) {
        this.resiverId = resiverId;
    }


}
